针对访问 uri 限制 ip

        在虚拟主机配置文件中加入如下字段:

1
2
3
4
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from 2.2.2.2

        假如该虚拟机的域名为 domain.com , 这样配置后,除了 127.0.0.1 和 2.2.2.2 外,其他ip访问以下类似的uri时都会直接禁止的。

1
2
3
4
http://domain.com/1212admin.txt
http://domain.com/admin.php
http://domain.com/1212/admin.html